<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden">
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<?=$_BASE_DIR?>css/style.css" rel="stylesheet" type="text/css">
<link href="<?=$_BASE_DIR?>css/dcmegamenu.css" rel="stylesheet" type="text/css" />
<link href="<?=$_BASE_DIR?>css/navgrey.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=$_BASE_DIR?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?=$_BASE_DIR?>js/jquery.blockUI.js"></script>
<script type="text/javascript" src="<?=$_BASE_DIR?>js/jquery-ui.min.js"></script>
<script type='text/javascript' src='<?=$_BASE_DIR?>js/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='<?=$_BASE_DIR?>js/jquery.dcmegamenu.1.2.js'></script>
<link href="<?=$_BASE_DIR?>css/block.css" rel="stylesheet" type="text/css" />
<link href="<?=$_BASE_DIR?>css/jquery-ui-theme.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="<?=$_BASE_DIR?>js/calendar/skins/default/theme.css" rel="stylesheet"/>
<script type="text/javascript" src="<?=$_BASE_DIR?>js/calendar/calendar.js"></script>
<script type="text/javascript" src="<?=$_BASE_DIR?>js/calendar/calendar-setup.js"></script>
<script type="text/javascript" src="<?=$_BASE_DIR?>js/calendar/lang/calendar-zh-utf8.js"></script>
<style type="text/css">
/*
#content>.inner {
	height:100%;
}
#main {
	height:100%;
	_height:90%;
}
*/
</style>
<script type="text/javascript">
var isie6 = navigator.userAgent.indexOf('IE 6') > -1;
function showmenu(m,t) {
	$('#navm').show();
	$('#content').css('marginLeft', 190);
	isie6 && $('#main').width($('#content').width()*.98);
	$('#leftmenu_'+m).show().siblings().hide();
	$('#menuli_'+t+'>a').addClass('here').parent().siblings('.nav').find('>a').removeClass('here');
	gotab0();
}
function showsubmenu(t) {
	$('#menuli_'+t+'>a').addClass('here').parent().siblings('.nav').find('>a').removeClass('here');
	gotab0();
}
function gotab0() {
	document.cookie = 'webfxtab_tabPane1=0;path=/';
}
function showwel() {
	main.location='<?php echo url("default/welcome");?>';
	$('#navm').hide();
	$('#content').css('marginLeft', 10);
	isie6 && $('#main').width($('#content').width()*.98);
}
function hidemenu() {
	$('#navm').hide();
	$('#content').css('marginLeft', 10);
	isie6 && $('#main').width($('#content').width()*.98);
}
function resize_main() {
	$('#main').height(document.documentElement.clientHeight - $('#main').offset().top - 18);
	$('#navm').height($('#content').prop('offsetHeight'));
}
$(function() {
	function n2(n) {
		return n < 10 ? '0'+n : n;
	}

	//服务器时间
	function show_timer() {
		var d = new Date(now_time++ *1000);
		$('#stimer').text('现在是'+d.getFullYear()+'年'+n2(d.getMonth()+1)+'月'+n2(d.getDate())+'日 '+n2(d.getHours())+':'+n2(d.getMinutes())+':'+n2(d.getSeconds()));
	}
	var now_time = <?php echo $now_time;?>;
	setInterval(show_timer, 1000);
	show_timer();


	//if (!isie6) {
		resize_main();
		$(window).resize(resize_main);
	//}
});
</script>
<!--[if IE 6]>
	<script type="text/javascript" src="<?=$_BASE_DIR?>js/DD_belatedPNG.js"></script>
	<script type="text/javascript">
	DD_belatedPNG.fix('.dc-mega-icon,.png_bg');
	</script>
<![endif]-->

</head>
<body>
<?php if($new):?>
<div style="width:100%;height:20px;background-color:#ffffe5; display:block;vertical-align:middle; padding:10px 5px;"><?php echo $new['content'];?></div>	
<? endif?>
<div id="head"></div>

<div id="menu">
	<div class="grey">
	  <ul id="mega-menu-3" class="mega-menu">
		<?php
		$i=0;
		$sys_perms = array();
		foreach ($all_perms as $gk=>$group) {
			$sys_perms[$gk] = $group;
		}
		$show_type_2 = 0;//是否显示系统设置
		$show_type_3 = 0;//是否显示系统统计
		//print_r($all_perms);
		foreach ($all_perms as $gk=>$group) {
			if (!Admin::has_mg_perm($gk)) continue;
			if($group['_type'] == 2) $show_type_2 = 1;
			if($group['_type'] == 3) $show_type_3 = 1;
			if($group['_type'] !=1) continue;
			unset($sys_perms[$gk]);
			
		?>
		<li id="navmenu_<?php echo $gk;?>"><a href="javascript:;">
		  <?=$group['_label']?>
		  </a>
		  <ul>
			<?php foreach ($group as $k=>$module) {
			if ($k == '_label') continue;
			
			if (!hp($k)) continue;
			if (isset($module["show"])&&empty($module["show"])) continue;
			?>
			<li><a href="<?=$_BASE_DIR.$module['url']?>" target="main" onclick="showmenu('<?php echo $gk;?>','<?php echo $k;?>')">
			  <?=$module['name']?>
			  </a></li>
			<?php }?>
		  </ul>
		</li>
		<?php }?>
		<?php if($show_type_3){?>
		<li><a href="javascript:;">统计分析</a>
		  <ul>
			<?php
			foreach ($sys_perms as $gk=>$group) {
				if (!Admin::has_mg_perm($gk)) continue;
				if($group['_type'] !=3) continue;
				unset($sys_perms[$gk]);
			?>
			<li><a href="javascript:;">
			  <?=$group['_label']?>
			  </a>
			  <ul>
				<?php foreach ($group as $k=>$module) {
					if ($k == '_label') continue;
					if (!hp($k)) continue;
					?>
				<li><a href="<?=$_BASE_DIR.$module['url']?>" target="main" onclick="showmenu('<?php echo $gk;?>','<?php echo $k;?>')">
				  <?=$module['name']?>
				  </a></li>
				<?php }?>
			  </ul>
			</li>
			<?php }?>
		  </ul>
		</li>
		<?php }?>
		<?php if($show_type_2){?>
		<li><a href="javascript:;">系统设置</a>
		  <ul>
			<?php
			foreach ($sys_perms as $gk=>$group) {
				if (!Admin::has_mg_perm($gk)) continue;
				if($group['_type'] !=2) continue;
				unset($sys_perms[$gk]);
			?>
			<li><a href="javascript:;">
			  <?=$group['_label']?>
			  </a>
			  <ul>
				<?php foreach ($group as $k=>$module) {
					if ($k == '_label') continue;
					if (!hp($k)) continue;
					?>
				<li><a href="<?=$_BASE_DIR.$module['url']?>" target="main" onclick="showmenu('<?php echo $gk;?>','<?php echo $k;?>')">
				  <?=$module['name']?>
				  </a></li>
				<?php }?>
			  </ul>
			</li>
			<?php }?>
		  </ul>
		</li>
		<?php }?>
	  </ul>
	</div>
	<script type="text/javascript">

	$('#mega-menu-3').dcMegaMenu({
		rowItems: '2',
		speed: 'fast',
		effect: 'fade'
	});
	
	</script>
</div>

<div id="mainc">

<div id="navm" style="display:none;">
    <?
	$i=0;
	foreach ($all_perms as $gk=>$group) {
		if (!Admin::has_mg_perm($gk)) continue;
	?>
	<div id="leftmenu_<?php echo $gk;?>" style="display:none">
		<div class="navup"><?=$group['_label']?></div>
        <?foreach ($group as $k=>$module) {?>
        <?
		if ($k == '_label') continue;
		//规整导航，完成时去掉注释
		if (!hp($k)) continue;
		if (isset($module["show"])&&empty($module["show"])) continue;
		?>
		<div id="menuli_<?php echo $k;?>" class="nav"><a href="<?=$_BASE_DIR.$module['url']?>" target="main" onclick="showsubmenu('<?php echo $k;?>')"><?=$module['name']?></a></div>
        <?}?>
	</div>
	<?}?>
	<div id="leftmenu_lms" style="display:none">
	</div>
<div id="navdown"></div>
</div>

<div id="content" style="margin-left:10px">

<div id="position">
<div class="left"><a href="<?php echo url('index');?>" target="_blank">首页</a> <a href="javascript:;" class="fr1" onclick="showwel()">开始页</a></div>
<div class="right"><span id="stimer"></span> | 用户: <?php echo($user['name']);?>　|　<a href="javascript:;" onclick="main.location.reload()">刷新</a> <a href="javascript:;" onclick="history.back()">上一步</a> <a href="javascript:;" onclick="history.forward()">下一步</a> <a href="<?php echo url("admin/logout");?>">退出</a></div>
<div class="clear"></div>
</div>

<div class="inner">
    <iframe id="main" name="main" src="<?php echo url("default/welcome");?>" frameborder="0" scrolling="yes" style="visibility:inherit;z-index:1"></iframe>
</div>

<div style="height:10px;"></div>
</div>

<div class="clear"></div>
</div>
</body>
</html>
